<%@ page  contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<script language="javascript">

  function clear_equi_info()
  {
	  $.CurrentNavtab.find('#areaCode,#tongyicode,#quyu').val("");
  }
  function dataExport()
  {
	  var datetime =  $.CurrentNavtab.find("#datetime").val();
	  var dateend = $.CurrentNavtab.find("#datetimeend").val();
	   $.CurrentNavtab.find("#export_datetime").attr("value",datetime);
	   $.CurrentNavtab.find("#export_datetimeend").attr("value",dateend);
	   $.CurrentNavtab.find("#exportData").submit();
  }
</script>
<div class="bjui-pageHeader">
<form id="exportData" name="exportData" method="post" action="${pageContext.request.contextPath}/equi/selectExport.do">
	 <input type="hidden" name="tongyicode" id="tongyicode" value="${tongyicode}"/> 
	 <input type="hidden" name="areaCode" id="export_areaCode" value=""/>
	 <input type="hidden" name="flag" id="export_flag" value="zk"/>
	 <input type="hidden" name="quyu" id="export_quyu" value=""/>
	 <input type="hidden" name="mess" id="mess" value="${mess}"/>
	 </form>
    <form id="pagerForm" data-toggle="ajaxsearch" action="${pageContext.request.contextPath}/equi/selectZKRtu.do" method="post">
        <div class="bjui-searchBar clearfix">
        	
			<div class="search-group">   
			 <input type="hidden" name="pageSize" value="${pagePara.pageSize}"/>
			 <input type="hidden" name="pageIndex" value="${pagePara.pageIndex}"/>    

	             <label>地区：</label>
	            <select name="Areacode" id="Areacode">
	              <option value="">请选择</option>
	              <c:forEach items="${areaList}" var="area">
	                <option value="${area.ucode}">${area.uname}</option>
	              </c:forEach>
	            </select>
	             <label>设备编号：</label>
	            <input type="text"  name="tongyicode" id="tongyicode" size="20" value="${rtu.tongyicode}"/> 
	            <label>测点名称：</label>
	            <input type="text"  name="quyu" id="quyu" size="20" value="${rtu.quyu}"/> 
	            <button type="submit" class="btn-default" data-icon="refresh">搜索</button>
	            <button type="button" id="equi_export" class="btn-default" data-icon="refresh" onclick="dataExport()">导出数据</button>
	            <button type="button" class="btn-default" data-icon="refresh" onclick="clear_equi_info()">清空</button>
            </div>
        </div>
    </form>	
</div>
	<div class="bjui-pageContent tableContent">
	    <table data-toggle="tablefixed" class="table table-bordered table-hover table-striped table-top center" data-width="100%">
	    	<thead>
				<tr>
					<th width="8%">设备编号</th>
					<th width="17%">测点名称</th>	
					<th>SIM卡号</th>	
					<th>水位标高(m)</th>
					<th>地面标高(m)</th>
					<th width="5%">电导率</th>
					<th>温度(°C)</th>				
					<th >最新数据采集时间</th>	
					<th>报警信息</th>			
				    <th width="13%">操作</th>
				</tr>
	    	</thead>
	    	<tbody>
	    	<c:forEach var="usr" varStatus="status" items="${list}">
	    	<tr>
			    		<td>${usr.tongyicode}</td>
						<td>${usr.quyu}</td>
                        <td>${usr.simkahao}</td>
                        <td>${usr.shuiweibiaogao}</td>                        	
                        <td>${usr.dimianbiaogao}</td>
                        <td>${usr.diandaolv}</td>
                        <td>${usr.wendu}</td>                        
                        <td><fmt:formatDate value="${usr.caijishijian}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td style="color:red">${usr.warning}</td>				
	    		<td>
    				  <a href="<%=request.getContextPath()%>/equi/selectZKSingle.do?tongyicode=${usr.tongyicode}" 
    				  class="btn btn-green" data-toggle="navtab" data-width="500" data-height="500" 
    				  data-id="user_edit_nav" data-title="查看设备信息" data-mask="true">设备信息</a>
    				  
    				  <a href="${pageContext.request.contextPath}/data/selectZKData.do?tongyicode=${usr.tongyicode}" 
    				  class="btn btn-green" data-toggle="navtab" data-width="500" data-height="500" 
    				  data-id="user_edit_nav" data-title="查看采集数据" data-mask="true">数据列表</a>
    				  <span class="btn-sep"></span>  
	    		</td>
	    	</tr>
	    	</c:forEach>
	    	</tbody>
	    </table>
	</div>
	<div class="bjui-pageFooter">
    <div class="pages">
       
        <span>&nbsp;共 ${pagePara.total } 条</span>
    </div>
    <div class="pagination-box pull-left" data-toggle="pagination" data-total=" ${pagePara.total }" data-page-size=" ${pagePara.pageSize}" data-page-current="${pagePara.pageIndex}"></div>
</div>